package com.noah.project.socket

import com.corundumstudio.socketio.SocketIOServer
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.CommandLineRunner
import org.springframework.core.annotation.Order
import org.springframework.stereotype.Component


@Component
@Order(value = 1)
class MsgRunner @Autowired
constructor(private val server: SocketIOServer) : CommandLineRunner {


    @Throws(Exception::class)
    override fun run(vararg args: String) {
        server.start()
        LoggerFactory.getLogger("MessageEventHandler").info("socket.io启动成功！")
    }
}
